exports.Date = {
  formatDate: function(time) {
    let _ = ['00', '01', '02', '03', '04', '05', '06', '07', '08', '09']; //补零
    let tmpDate = new Date(time);
    let year = tmpDate.getFullYear();
    let mathon = tmpDate.getMonth() + 1;
    let day = tmpDate.getDate();
    let hours = tmpDate.getHours();
    let minutes = tmpDate.getMinutes();
    return mathon + '月' + day + '日 ' + [_[hours] || hours,
      _[minutes] || minutes
    ].join(":");
  }

}


export function deepClone(obj) {
  if (Array.isArray(obj)) {
    return obj.map(deepClone)
  } else if (obj && typeof obj === 'object') {
    var cloned = {}
    var keys = Object.keys(obj)
    for (var i = 0, l = keys.length; i < l; i++) {
      var key = keys[i]
      cloned[key] = deepClone(obj[key])
    }
    return cloned
  } else {
    return obj
  }
}
